﻿using YDT_ABPvNext_Projects.Localization;
using Volo.Abp.AuditLogging;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.TenantManagement;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;

namespace YDT_ABPvNext_Projects;

[DependsOn(
    typeof(AbpAuditLoggingDomainSharedModule),
    typeof(AbpIdentityDomainSharedModule),
    typeof(AbpPermissionManagementDomainSharedModule),
    typeof(AbpTenantManagementDomainSharedModule)    
    )]
public class YDT_ABPvNext_ProjectsDomainSharedModule : AbpModule
{
    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        YDT_ABPvNext_ProjectsGlobalFeatureConfigurator.Configure();
        YDT_ABPvNext_ProjectsModuleExtensionConfigurator.Configure();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpVirtualFileSystemOptions>(options =>
        {
            options.FileSets.AddEmbedded<YDT_ABPvNext_ProjectsDomainSharedModule>();
        });

        Configure<AbpLocalizationOptions>(options =>
        {
            options.Resources
                .Add<YDT_ABPvNext_ProjectsResource>("en")
                .AddBaseTypes(typeof(AbpValidationResource))
                .AddVirtualJson("/Localization/YDT_ABPvNext_Projects");

            options.DefaultResourceType = typeof(YDT_ABPvNext_ProjectsResource);
        });

        Configure<AbpExceptionLocalizationOptions>(options =>
        {
            options.MapCodeNamespace("YDT_ABPvNext_Projects", typeof(YDT_ABPvNext_ProjectsResource));
        });
    }
}
